package com.lyz.dataStructure.algorithm.科大讯飞2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 10:32
 * @Description:
 **/

import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/9/12 10:32
 *@Description:
 **/
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        StringBuffer result = new StringBuffer();
        char word1 = str.charAt(0);
        int sum =0;
        for(int i =1;i<str.length();i++){
            char word2 = str.charAt(i);
            if(word1==word2){
                sum++;
                continue;
            }
            result.append(sum).append(word1);
            word1 = word2;
            sum =1;
        }
        System.out.println(result.append(sum).append(word1));
    }

}
